import { ref, Ref, watchEffect } from 'vue'
import { NumData, TotalData } from '../types'

// 测评完成概况
export function useEvaluationCompletionOverview({
  numData,
  totalData,
}: {
  numData: Ref<NumData | null>
  totalData: Ref<TotalData | null>
}) {
  const testBarSeriesData = ref<number[]>([])
  watchEffect(() => {
    testBarSeriesData.value = [
      // totalData.value?.studentTotal,
      // numData.value?.allTestNum?.[0]?.num || 0,
      numData.value?.findReleaseFinishTestNum?.[0]?.num || 0,
      numData.value?.finishTestNum?.[0]?.num || 0,

      numData.value?.findNoReleaseFinishTestNum?.[0]?.num || 0,
      // numData.value?.finishNoTestNum?.[0]?.num || 0,
    ]
  })

  return {
    testBarSeriesData,
  }
}
